from ChipSchduile.model.MILP import SemiconductorScheduler
from ChipSchduile.model.utils import print_schedule_results
from base import Task,Job,create_job
from ParamaGenerator import ParamterGenerator

if __name__ == "__main__":
    # 参数初始化
    # 任务信息
    # 创建工件
    job_creator = create_job()
    job_d = job_creator.generator_job_d()
    job_c = job_creator.generator_job_c()

    # 创建任务实例
    task = Task(
        name="任务-5c",
        job_types=[job_c, job_d],
        job_counts=[25, 20]
    )

    task.print_task_info()

    paramter_generator = ParamterGenerator(task)

    # 生成参数
    params = paramter_generator.generate_all_params()
    paramter_generator.pretty_print_dict(params)

    # # 创建并求解模型
    model = SemiconductorScheduler(params)
    result = model.optimize()

    # 5. 输出求解结果
    print_schedule_results(result)